<script setup>
import BookIndex from './components/BookIndex.vue'
</script>

<template>
  <n-config-provider>
    <n-message-provider>
      <n-layout>
        <n-layout-header class="header">
          <div class="header-content">
            <div class="logo-container">
              <img src="/vite.svg" class="logo" alt="Vite logo" />
              <img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
              <h1>图书索引系统</h1>
            </div>
          </div>
        </n-layout-header>
        <n-layout-content class="content">
          <BookIndex />
        </n-layout-content>
        <n-layout-footer class="footer">
          图书索引系统 &copy; 2025
        </n-layout-footer>
      </n-layout>
    </n-message-provider>
  </n-config-provider>
</template>

<style scoped>
.header {
  background-color: #f8f8f8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
}

.header-content {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-container h1 {
  margin: 0;
  font-size: 1.5rem;
  color: #333;
}

.logo {
  height: 2.5em;
  padding: 0.5em;
  will-change: filter;
  transition: filter 300ms;
}

.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}

.logo.vue:hover {
  filter: drop-shadow(0 0 2em #42b883aa);
}

.content {
  min-height: calc(100vh - 124px);
  background-color: #f5f7fa;
}

.footer {
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f8f8f8;
  color: #666;
  font-size: 0.9rem;
}
</style>
